home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00004_Script_qtvr menu < prev    next >
Text File  |  1999-04-25  |  6KB  |  154 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13.  
  14.  
  15. --This behavior changes the pare of corresponding images (qtvr menu item and plane diagram) when you roll over one of them  and  then passes the mouseUp event to the castMember script.Each menu consists of 5 pares of items and each item has 3 states:
  16. --
  17. --1) neutral: when it's not selected and not rolled over
  18. --2)rolledOver: when it's not selected and rolled over
  19. --3)hilited: when it's selected 
  20. --
  21. --Corresponding castMembers are always located in curtain order in the internal cast.It makes it possible to switch between them depending on the item's state by manipulating their castNum.
  22. -------------------------------------------------------
  23. property rolledOver
  24. --global gQTVRmenuEnabled
  25.  
  26. on getbehaviorDescription
  27.   return "changes the image on rollover"
  28. end
  29.  
  30. on new me
  31.   set rolledOver = FALSE
  32. end
  33.  
  34.  
  35.  
  36.  
  37. on mouseEnter me
  38.   global gSelct,NumOfQTVRMenuItems
  39.   if not rolledOver then
  40.     
  41.     set qtvrPlaneSprNum = getSpriteNumFromMemberName("qtvranchor")+1
  42.     set range = NumOfQTVRMenuItems - 1
  43.     set exteriorSpriteNum = qtvrPlaneSprNum + range
  44.     if gSelct <> (the spritenum of me/2*2) then 
  45.       
  46.       set the castnum of sprite the spritenum of me¼
  47.     to the castnum of sprite the spritenum of me + range
  48.       --if not exterior set also the linked menu item
  49.       if the spritenum of me <> exteriorSpriteNum then 
  50.         if the spritenum of me/2*2 = the spritenum of me then
  51.           --even sprite number:rolled over the plane diagram, have to change menu item
  52.           set the castnum of sprite the spritenum of me +1 to the castnum of sprite the spritenum of me - 1
  53.         else
  54.           --odd sprite number:rolled over the menu item, have to change plane diagram
  55.           set the castnum of sprite the spritenum of me -1 to the castnum of sprite the spritenum of me + 1
  56.           updatestage 
  57.         end if
  58.       end if
  59.       puppetsound 3, "subroll"     
  60.     end if
  61.     set rolledOver = TRUE
  62.   end if
  63.   
  64. end
  65.  
  66.  
  67. on mouseleave me
  68.   global gSelct, NumOfQTVRMenuItems
  69.   if rolledOver then
  70.     set qtvrPlaneSprNum = getSpriteNumFromMemberName("qtvranchor")+1
  71.     set range = NumOfQTVRMenuItems - 1
  72.     set exteriorSpriteNum = qtvrPlaneSprNum + range
  73.     if gSelct <> (the spritenum of me/2*2) then
  74.       
  75.       set the castnum of sprite the spritenum of me to ¼
  76.     the castnum of sprite the spritenum of me -range
  77.       
  78.       --if not exterior set also the linked menu item
  79.       
  80.       if the spritenum of me <> exteriorSpriteNum then
  81.         
  82.         if the spritenum of me/2*2 = the spritenum of me then
  83.           --even sprite number:rolled over the plane diagram, have to change menu item
  84.           set the castnum of sprite the spritenum of me +1 to¼
  85.         the castnum of sprite the spritenum of me - 1
  86.         else
  87.           --odd sprite number:rolled over the menu item, have to change plane diagram
  88.           set the castnum of sprite the spritenum of me-1 to¼
  89.         the castnum of sprite the spritenum of me + 1
  90.           updatestage
  91.         end if
  92.         
  93.       end if
  94.       
  95.     end if
  96.     set rolledOver = FALSE
  97.   end if
  98.   
  99.   
  100. end
  101.  
  102.  
  103. on mouseup me
  104.   --  First three enclosing if statements are for synchronization purposes.To make sure that all lingo commands caused by previouse qtvr menu item selection were executed before a new item can be selected.
  105.   
  106.   global gSelct, NumOfQTVRMenuItems, gImage, imageName, gQTVRmenuEnabled
  107.   
  108.   if rolledOver then
  109.     if the frame <> marker("qtvr") then
  110.       if gQTVRmenuEnabled then
  111.         
  112.         set gQTVRmenuEnabled = FALSE
  113.         set qtvrPlaneSprNum = getSpriteNumFromMemberName("qtvranchor")+1
  114.         set range = NumOfQTVRMenuItems - 1
  115.         set exteriorSpriteNum = qtvrPlaneSprNum + range
  116.         puppetsound 3,"mouse5"
  117.         
  118.         if gSelct <> (the spritenum of me/2*2) and gSelct <>"" then
  119.           set the castnum of sprite gSelct to gImage 
  120.           if gSelct <> exteriorSpriteNum then set the castnum of sprite gSelct+1 to gImage-1 
  121.         end if
  122.         
  123.         if gSelct <> (the spritenum of me/2*2) then
  124.           set gSelct = the spritenum of me/2*2
  125.           set gImage = the castnum of sprite (the spritenum of me/2*2) - range
  126.           set the castnum of sprite the spritenum of me to the castnum of sprite the spritenum of me +range
  127.         end if
  128.         
  129.         
  130.         
  131.         --if not exterior set also the linked menu item
  132.         if the spritenum of me <> exteriorSpriteNum then 
  133.           if the spritenum of me/2*2=the spritenum of me then
  134.             --even sprite number
  135.             set the castnum of sprite the spritenum of me +1 to the castnum of sprite the spritenum of me - 1
  136.           else
  137.             set the castnum of sprite the spritenum of me -1 to the castnum of sprite the spritenum of me+1
  138.           end if 
  139.         end if
  140.         set imageName = the name of member gImage
  141.         
  142.         --  sendAllSprites(#CDSmallMenuPuppetsOff)
  143.         
  144.         pass
  145.       end if
  146.     end if
  147.   end if
  148.   
  149. end
  150.  
  151. on resetRolledover me
  152. --  This handler is called when "return to aircraft" button on Avionics Intro screen is clicked
  153.   set rolledOver = FALSE
  154. end